
<?php header("Cache-Control: no-cache, must-revalidate");
 
session_start();

session_register("lin");
session_register("pagi");
session_register("lineasxpagi");

 $nombre=$HTTP_GET_VARS['nombre'];

 
if (!isset($krd)) $krd = $_POST['krd']; else $krd = $_GET['krd'];
$ruta_raiz="../..";
if(!isset($_SESSION['dependencia']))	include "$ruta_raiz/rec_session.php";
require_once("$ruta_raiz/include/db/ConnectionHandler.php");
?>
<!--<link href="<?=$ruta_raiz?>/auditoria/css/ventana-modal.css" rel="stylesheet" type="text/css">
<script type="text/javascript" src="<?=$ruta_raiz?>/auditoria/js/ventana-modal.js"></script>-->
<?
$db = new ConnectionHandler($ruta_raiz);
$db->conn->SetFetchMode(ADODB_FETCH_ASSOC);	 

?>

<?
$error = 0;

if (isset($b_com))
{
   switch ($b_com)
   {
      case "<--":
         $pagi=$pagi-$lineasxpagi;
         if ($pagi<0)
             $pagi=0;
         mostrar_compr();
         break;
      case "-->":
         $pagi=$pagi+$lineasxpagi;
         mostrar_compr();
         break;

      case "-->|":
         $pagi=floor(count($mat_sol) / $lineasxpagi);
         $pagi=$pagi*$lineasxpagi;
         mostrar_compr();
         break;

      case "|<--":
         $pagi=0;
         mostrar_compr();
	 break;
      case "Nit":
	$pagi=0;
	usort($mat_sol, "comparar_nit");
 	 mostrar_compr();
      break;
     case "Nombre":
	$pagi=0;
	usort($mat_sol, "comparar_nombre");
 	 mostrar_compr();
      break;	
   }
}
 
   
   $sel_comp=" $sel_comp 1=1 ";
	include('$ruta_raiz/adodb/adodb.inc.php'); # Carga el codigo de ADOdb   
   
   $consulta = "SELECT a.sgd_ciu_cedula AS CEDULA, 
	   				a.sgd_ciu_nombre AS NOMBRE, 
					a.sgd_ciu_apell1 AS APELLIDO1, 
					a.sgd_ciu_apell1 AS APELLIDO2, 
					a.sgd_ciu_email AS EMAIL, 
					a.sgd_ciu_telefono AS TELEFONO, 
					a.sgd_ciu_direccion AS DIRECCION 
				FROM sgd_ciu_ciudadano a 
				WHERE 1=1 
					AND  $sel_comp 
					AND a.sgd_ciu_nombre like '%$nombre%' ";

   $ADODB_COUNTRECS = true; 
   $rs = $db->conn->Execute($consulta);
	$conteo=$rs->RowCount();
	$cad=$rs->RecordCount();
	
   
   if($conteo==0){
   		echo "<TABLE ALIGN='CENTER' valign='center'>";
		   ?><tr style="background-color: #E3E8EC" ><br /><br /><br />
		   <td ><small><b>Coincidencias NO Encontradas</small></td></b>
		    <script>
		  		close();
			</script> 
		   </table>
		   <?}
  
 

?>
<html>
<head>
<body>
<link rel="stylesheet" href="../../estilos/orfeo.css">

<script>
function solic(c,d,e,f,g,h,i)
{
			
		opener.document.form1.documento.value=c.value;
		opener.document.form1.txt_name_ciu.value=d.value;
		opener.document.form1.primer_apellido.value=e.value;
		opener.document.form1.segundo_apellido.value=f.value;
		opener.document.form1.txt_mail.value=g.value;
		opener.document.form1.txt_tel1.value=h.value;
        opener.document.form1.txt_dir.value.toUpperCase( );
		opener.document.form1.txt_dir.value=i.value;
	    window.close();
	
  	    
}
</script>
<?$rs->fields["CEDULA"]= str_replace("??","&oacute;",$rs->fields["CEDULA"]);?>
<table border="0" width="100%" cellspacing="0" cellpadding="0" height="100%">
<tr><td width="100%"  height="100%">
<?php $titulo="Nits "; ?>
<table border="0" width="100%" align="center" cellspacing="0" cellpadding="0" height="100%">
  <tr><td align="center">
       <table border="0" align="center" cellspacing="0" cellpadding="0">

       <form action="nit.php" method="post" name="banco">
        <tr><td>
	  <table border="1" cellspacing="0" cellpadding="0"  >
          <tr style="background-color: #006699" onmouseover="this.style.backgroundColor = '#006699'"  >
         <td></td>
		  <th nowrap>
		  
		  <input type='submit' value='C&eacute;dula' id='docu' name='b_com' style='background-color: #006699; height: 18; font-size: 12px; font-color: #ffffff; border-style: solid; border-width: 0' >
		
	<th nowrap>
	<input type='submit' value='Nombre Ciudadano' id='docu' name='b_com' style='background-color: #006699; height: 18; font-size: 9px; font-color: white; border-style: solid; border-width: 0'> </th></tr>
        <?
              $h=0;
              
	while(!$rs->EOF)
     	      {
            ?>
<tr style="background-color: #E3E8EC" onmouseover="this.style.backgroundColor = '#FFFFCC'" onmouseout="this.style.backgroundColor = '#E3E8EC'" >
<?

 					
    		  $simbolos = array(".", "-",",");
			  $rs->fields["CEDULA"] = str_replace($simbolos, "", $rs->fields["CEDULA"]);
	echo "
	<td>
	<input type=radio name=x onclick='solic(this.form.c$h, this.form.d$h, this.form.e$h, this.form.f$h, this.form.g$h, this.form.h$h, this.form.i$h)'></td>
	
	<input type=hidden name='c$h' value='".$rs->fields["CEDULA"]."'>
	<input type=hidden name='d$h' value='".$rs->fields["NOMBRE"]."'>
	<input type=hidden name='e$h' value='".$rs->fields["APELLIDO1"]."'>
	<input type=hidden name='f$h' value='".$rs->fields["APELLIDO2"]."'>
	<input type=hidden name='g$h' value='".$rs->fields["EMAIL"]."'>
	<input type=hidden name='h$h' value='".$rs->fields["TELEFONO"]."'>
	<input type=hidden name='i$h' value='".$rs->fields["DIRECCION"]."'>
	
	
	
	<td nowrap><small>".$rs->fields["CEDULA"]."</td><td><small>".$rs->fields["NOMBRE"]." ".$rs->fields["APELLIDO1"]." ".$rs->fields["APELLIDO2"]."</small></td>";	$rs->MoveNext();
	$h++;	
	
	
       
		   }
        ?>
          </td></tr><td colspan='3' align= 'right' nowrap >     <?echo "<small>Registros: <b><font color=#FF0000>".$conteo."</small></font>";?></td>
           </table>
           <input type='submit' value='|<--' id='in_bco' name='b_com' style='background-color: #738EB5; height: 18; font-size: 10px; font-weight: bold; color: ffffff; border-style: solid; border-width: 1'>
           <input type='submit' value='<--' id='ant_bcor' name='b_com' style='background-color: #738EB5; height: 18; font-size: 10px; font-weight: bold; color: ffffff; border-style: solid; border-width: 1'>
           <input type='submit' value='-->' id='av_bco' name='b_com' style='background-color: #738EB5; height: 18; font-size: 10px; font-weight: bold; color: ffffff; border-style: solid; border-width: 1'>
           <input type='submit' value='-->|' id='f_bco' name='b_com' style='background-color: #738EB5; height: 18; font-size: 10px; font-weight: bold; color: ffffff; border-style: solid; border-width: 1'>
         </td></tr>
        </form>
       </table>
      <?php include('../configuracion/tablainferior.php');?>
    </td>
  </tr>
</table>
</td></tr>
</table>
</body>
</html>

